﻿using KWT.DRG_DIP.DO.System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace KWT.DRG_DIP.PO.qcRules
{
    /// <summary>
    /// 质控规则
    /// </summary>
    public class qc_Rules : Audit
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        public required string QRID { get; set; }

        /// <summary>
        /// 规则分类
        /// </summary>
        public string ruleCategory { get; set; } = "";

        /// <summary>
        /// 规则名称
        /// </summary>
        public required string ruleName { get; set; }

        /// <summary>
        /// 规则描述
        /// </summary>
        [StringLength(1000)]
        public string ruleDes { get; set; } = "";

        /// <summary>
        /// 问题分类
        /// </summary>
        public string problemCategory { get; set; } = "";

        /// <summary>
        /// 规则级别：预警 、强制、高度可疑
        /// </summary>
        public string ruleLevel { get; set; } = "";

        /// <summary>
        /// 规则属性：一级质控、二级质控、三级质控
        /// </summary>
        public string ruleProperties { get; set; } = "";

        /// <summary>
        /// 规则表达式(伪代码)
        /// </summary>
        public required string ruleExpressionIn { get; set; }

        /// <summary>
        /// 规则表达式
        /// </summary>
        public required string ruleExpression { get; set; }

        /// <summary>
        /// 规则json
        /// </summary>
        [Column(TypeName = "text")]
        public required string ruleJson { get; set; }

        /// <summary>
        /// 表达式结果
        /// </summary>
        public string ruleResult { get; set; } = "";

        /// <summary>
        /// 是否启用：1：启用；0：停用
        /// </summary>
        public int isEnable { get; set; } = 1;
    }
}
